package com.daisyday.dynamicagent;


import java.lang.reflect.Proxy;

/**
 * 动态代理
 * jdk动态代理必须通过接口
 * 代理类是通过asm字节码操作类框架创建的
 *
 *
 */
public class DynamicAgentMain {



    public static void main(String[] args) throws Exception {

//        System.getProperties().put("jdk.proxy.ProxyGenerator.saveGenerateFiles","true");
        Movable m = (Movable) Proxy.newProxyInstance(MovableImple.class.getClassLoader(),
                new Class[]{Movable.class},
                new InvocationHand()
        );
        m.move();
    }



}
